#参考文献
"""
to_json:
https://blog.csdn.net/qq_41780234/article/details/84990551/?utm_medium=distribute.pc_relevant.none-task-blog-2~default~baidujs_baidulandingword~default-5--blog-136349661.235^v43^pc_blog_bottom_relevance_base4&spm=1001.2101.3001.4242.4&utm_relevant_index=8

append row :
https://deepinout.com/pandas/pandas-questions/pandas-append_z2.html

delete row :
https://www.kdun.com/ask/476650.html

query :
https://www.jb51.net/article/235744.htm

"""
import pandas as pd
import pymssql 
print(pd)
 
# 连接MySQL数据库
conn = pymssql.connect( 
    host='47.92.172.14',
    port='10084',
    user='sa',
    password='YL120523#45^&Qm',
    database='cb2024',
    charset='UTF-8',
    as_dict=True
)
#conn = pymysql.connect(host='47.92.172.14', port=10084 , user='sa', password='Hhuc1115', database='cb2024',    charset='utf8')
# 读取数据
user = pd.read_sql('select * from T_Org', conn)
# 关闭连接
conn.close()
# 数据输出
user.head()
user.to_json(ascii(o))
print( user)


#connect(server='.', user=None, password=None, database='', timeout=0, login_timeout=60, charset='UTF-8', as_dict=False, host='', appname=None, port='1433', encryption=None, read_only=False, conn_properties=None, autocommit=False, tds_version=None, use_datetime2=False, arraysize=1)